home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / pyshared / softwareproperties / gtk / dialogs.py < prev    next >
Encoding:
Python Source  |  2009-03-27  |  1.2 KB  |  34 lines

  1. # dialogs - provide common dialogs
  2. #  
  3. #  Copyright (c) 2006 FSF Europe
  4. #              
  5. #  Authors: 
  6. #       Sebastian Heinlein <glatzor@ubuntu.com>
  7. #       Michael Vogt <mvo@canonical.com>
  8. #
  9. #  This program is free software; you can redistribute it and/or 
  10. #  modify it under the terms of the GNU General Public License as 
  11. #  published by the Free Software Foundation; either version 2 of the
  12. #  License, or (at your option) any later version.
  13. #  This program is distributed in the hope that it will be useful,
  14. #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. #  GNU General Public License for more details.
  17. #  You should have received a copy of the GNU General Public License
  18. #  along with this program; if not, write to the Free Software
  19. #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  20. #  USA
  21.  
  22. import gtk
  23.  
  24. def show_error_dialog(parent, primary, secondary):
  25.     p = "<span weight=\"bold\" size=\"larger\">%s</span>" % primary
  26.     dialog = gtk.MessageDialog(parent,gtk.DIALOG_MODAL,
  27.                                gtk.MESSAGE_ERROR,gtk.BUTTONS_CLOSE,"")
  28.     dialog.set_markup(p);
  29.     dialog.format_secondary_text(secondary);
  30.     dialog.run()
  31.     dialog.hide()
  32.